package src.itheima02;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class C {
    public static void main(String[] args) {
        Map<String,String>map=new LinkedHashMap<>();
        map.put("333","a");
        map.put("444","b");
        map.put("555","c");
        map.put("666","d");

        System.out.println(map);
        Set<Map.Entry<String, String>> set = map.entrySet();

        Iterator<Map.Entry<String,String>>iterator=set.iterator();
        while (iterator.hasNext()){
            Map.Entry<String,String> map1=iterator.next();
            System.out.println(map1);
            System.out.println(map1.getKey());
            System.out.println(map1.getValue());

        }
        System.out.println("-------------");
        for (Map.Entry<String, String> entry : set) {
            System.out.println(entry);
            System.out.println(entry.getKey());
            System.out.println(entry.getValue());
        }

    }
}
